<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html"/>
	
	<xsl:template match="/">
		<xsl:apply-templates select="*"/>
	</xsl:template>

	<xsl:variable name="chapterId" select="chapter/@chapId"/>
	<xsl:param name="caleComment"/>
	<xsl:variable name="comentarii" select="document($caleComment)/chapterComments"/>

	<xsl:template match="title">
		<div>
			<p align="center">
				<xsl:value-of select="text()"/>
			</p>
			<input id="curentChapterId" type="hidden" value="{$chapterId}"/>
		</div>
	</xsl:template>

	<xsl:template match="paragraph">
		<xsl:variable name="paraId" select="@paraId"/>
		<div class="paragraph" id="{$paraId}">
			<p id="{$paraId}p">
				<xsl:value-of select="text()"/>
			</p>
		</div>
		<xsl:if test="$comentarii/chapterComment[commentElementId=$paraId]">
			<div class="commentHelder">
				<span class="commentAnnouncement">++Comentarii</span><br/>
				<div class="comment">
					<div class="commentHeader" align="left">
						<b>Comentarii...</b>
					</div>
					<xsl:for-each select="$comentarii/chapterComment[commentElementId=$paraId]">

						<div class="commentBody">
							<xsl:value-of select="commentAuthor"/>, <xsl:value-of select="commentDate"/><br/>
							<xsl:value-of select="commentContent"/>
						</div>
					</xsl:for-each>
				</div>
			</div>
		</xsl:if>
	</xsl:template>

	<xsl:template match="note"/>
	<xsl:template match="quote"/>
	<xsl:template match="image"/>
	<xsl:template match="table"/>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\documente\teste2\ch1t.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="..\..\documente\teste2\ch1t.xml" srcSchemaRoot="chapter" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/><SourceSchema srcSchemaPath="..\..\documente\teste2\ch1tComments.xml" srcSchemaRoot="chapterComments" AssociatedInstance="file:///c:/apache2triad/htdocs/php_projects/xmlDocument/documente/teste2/ch1tComments.xml" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="xsl:apply&#x2D;templates" x="64" y="0"/></template><template match="note"></template><template match="paragraph"><block path="div/p/xsl:value&#x2D;of" x="64" y="72"/><block path="xsl:for&#x2D;each" x="64" y="108"/><block path="xsl:for&#x2D;each/div/span/xsl:value&#x2D;of" x="50" y="144"/><block path="xsl:for&#x2D;each/div/span/xsl:value&#x2D;of[1]" x="104" y="144"/><block path="xsl:for&#x2D;each/div/span[1]/xsl:value&#x2D;of" x="49" y="185"/></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"><Fragment url="" path="" action=""/></MapperFilter></MapperMetaTag>
</metaInformation>
-->